home *** CD-ROM | disk | FTP | other *** search
- '------------------------------------------------------------------------ΒΌ
- 'This module is used to give three dimensional effects to message boxes, |
- 'input boxes, and common dialogs. Its use is simple: |
- ' |
- 'To begin 3D effects use StartApp3D. Its use is: StartApp3D. This |
- 'regesters your app with CTL3DV2.dll. Before you end your application |
- 'you must unregester your app. In the form's unload event place the |
- 'EndApp3D command. Its use is: EndApp3D. If your application ends |
- 'without unregestering an error will occure. This error will end VB if |
- 'your in the VB environment. It may also end windows. I have many |
- 'errors with CTL3D (versons 1 and 2) as well as this module, I can take |
- 'no responcibility - *USE AT YOUR OWN RISK*. |
- ' |
- 'This module uses CTL3DV2.DLL which must be located in the System |
- 'directory. Remember *USE AT YOUR OWN RISK* This module may still |
- 'contain bugs (I've tried to rid it of them). *USE AT YOUR OWN RISK* |
- '*USE AT YOUR OWN RISK* *USE AT YOUR OWN RISK* *USE AT YOUR OWN RISK* |
- '-------------------------------------------------------------------------
-
- ' 94/08/06 Minor changes made by Larry Rebich, The Bridge, Inc.
-
- Option Explicit
- DefInt A-Z
- ' Declare Sub ShellAbout Lib "SHELL.DLL" (ByVal hWnd, ByVal AppName$, ByVal AppInfo$, ByVal hIcon)
- Declare Function GetWindowWord Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Integer
- Declare Function Ctl3DAutoSubclass Lib "Ctl3Dv2.DLL" (ByVal hInst As Integer) As Integer
- Declare Function Ctl3DRegister Lib "Ctl3Dv2.DLL" (ByVal hInst As Integer) As Integer
- Declare Function Ctl3DUnregister Lib "Ctl3Dv2.DLL" (ByVal hInst As Integer) As Integer
-
- Const GWW_HINSTANCE = (-6)
-
- Sub EndApp3D ()
- Rem This Sub is used to end the 3D effects
- Rem IMPORTANT: you must end 3D effects before your app ends
- Dim inst, ret
- inst = GetWindowWord(Forms(0).hWnd, GWW_HINSTANCE) 'Get the Word of Frm
- ret = Ctl3DUnregister(inst) ' Unregister the program.
- End Sub
-
- Sub StartApp3D ()
- Rem Use this to start the 3D dialogs
- If Forms.Count = 0 Then
- Dim Msg As String
- Msg = "There is no loaded form. "
- Msg = Msg & "To register your app with CTL3DV2 "
- Msg = Msg & "there must be at least one loaded form. "
- Msg = Msg & Chr$(13) & Chr$(13)
- Msg = Msg & "Use the Load statement to load a form, "
- Msg = Msg & "use StartApp3D, then unload the form."
- MsgBox Msg, 48, "No Form Loaded"
- Exit Sub
- End If
- Dim inst, ret
- inst = GetWindowWord(Forms(0).hWnd, GWW_HINSTANCE) 'Get the Word from Frm
- ret = Ctl3DRegister(inst) ' Register program w/ Ctl3d.
- ret = Ctl3DAutoSubclass(inst) ' Subclass the program.
- End Sub
-
-